package lab02.test02;

import java.util.Scanner;

public class Test02 {

    static class Circle {

        float r;
        float i = 3.1415f;

        public void area() {
            float a;
            a = i * r * r;
            System.out.println("圆的面积为：" + a);
        }

        public void perimeter() {
            float b;
            b = 2 * i * r;
            System.out.println("圆的周长为：" + b);
        }

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Circle cie = new Circle();

        System.out.println("请输入圆的半径：");

        cie.r = sc.nextFloat();
        cie.area();
        cie.perimeter();

    }
}
